package net.xgs.rbac.entity.role;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "role_role")
public class RoleRoleDto {
    private long id;
    private String name;
    private String roleDesc;
    private String enableState;
    private Long createTime;
    private long created;
    private String createdName;
    private Long orgId;
    private String serverId;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "role_desc")
    public String getRoleDesc() {
        return roleDesc;
    }

    public void setRoleDesc(String roleDesc) {
        this.roleDesc = roleDesc;
    }

    @Basic
    @Column(name = "enable_state")
    public String getEnableState() {
        return enableState;
    }

    public void setEnableState(String enableState) {
        this.enableState = enableState;
    }

    @Basic
    @Column(name = "create_time")
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "created")
    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    @Basic
    @Column(name = "created_name")
    public String getCreatedName() {
        return createdName;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    @Basic
    @Column(name = "org_id")
    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    @Basic
    @Column(name = "server_id")
    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoleRoleDto that = (RoleRoleDto) o;
        return id == that.id &&
                created == that.created &&
                Objects.equals(name, that.name) &&
                Objects.equals(roleDesc, that.roleDesc) &&
                Objects.equals(enableState, that.enableState) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createdName, that.createdName) &&
                Objects.equals(orgId, that.orgId) &&
                Objects.equals(serverId, that.serverId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, roleDesc, enableState, createTime, created, createdName, orgId, serverId);
    }
}
